Change in openvpn[master]: win: remove Wintun support
A message that is not in the archive (sent off-list or not yet received): gerrit.1747046041000.I43ec390040bffeec05270271ea7fb54fb219c536@...2715...
Attention is currently required from: flichtenheld, plaisthos.
Hello plaisthos, flichtenheld,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email
to review the following change.
Change subject: win: remove Wintun support
......................................................................
win: remove Wintun support
Since DCO supports modern ciphers and server mode, there is no reason to support Wintun anymore.
This also removes --windows-driver option support. The default driver is DCO, as it has been since 2.6. If for some reasons one doesn't want to use it, --disable-dco multiplatform option will switch to tap-windows6.
Remains of wintun code will be removed later from
MSI custom actions after installer change.
---
M doc/man-sections/vpn-network-options.rst
M doc/man-sections/windows-options.rst
M include/openvpn-msg.h
M src/openvpn/Makefile.am
M src/openvpn/dco.c
M src/openvpn/forward.c
M src/openvpn/forward.h
M src/openvpn/mudp.c
M src/openvpn/multi_io.c
M src/openvpn/options.c
D src/openvpn/ring_buffer.h
M src/openvpn/tun.c
M src/openvpn/tun.h
M src/openvpnserv/CMakeLists.txt
M src/openvpnserv/Makefile.am
M src/openvpnserv/interactive.c
16 files changed, 22 insertions(+), 774 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/21/1021/1
doc/man-sections/vpn-network-options.rst +1 -2
@@ -137,8 +137,7 @@ Set additional network parameters on supported platforms. May be specified on the client or pushed from the server. On Windows these options are handled by the ``tap-windows6`` driver by default or directly by OpenVPN - if dhcp is disabled or the ``wintun`` driver is in use. The - ``OpenVPN for Android`` client also handles them internally. + if dhcp is disabled. The ``OpenVPN for Android`` client also handles them internally. On all other platforms these options are only saved in the client's environment under the name :code:`foreign_option_{n}` before the
doc/man-sections/windows-options.rst +0 -6
@@ -252,9 +252,3 @@ otherwise it defaulted to :code:`C:\\WINDOWS`. It is not needed to use the ``env`` keyword any more, and it will just be ignored. A warning is logged when this is found in the configuration file. - ---windows-driver drv - Specifies which tun driver to use. Values are :code:`ovpn-dco` (default), - :code:`tap-windows6` and :code:`wintun`. :code:`ovpn-dco` and :code:`wintun` - require ``--dev tun``. :code:`wintun` also requires OpenVPN process to run - elevated, or be invoked using the Interactive Service.
include/openvpn-msg.h +0 -10
@@ -44,7 +44,6 @@ msg_del_wfp_block, msg_register_dns, msg_enable_dhcp, - msg_register_ring_buffers, msg_set_mtu, msg_add_wins_cfg, msg_del_wins_cfg
@@ -158,15 +157,6 @@ typedef struct { message_header_t header; -HANDLE device; -HANDLE send_ring_handle; -HANDLE receive_ring_handle; -HANDLE send_tail_moved; -HANDLE receive_tail_moved; -}register_ring_buffers_message_t ; - -typedef struct { - message_header_t header; interface_t iface; short family; int mtu;
src/openvpn/Makefile.am +1 -1
@@ -163,6 +163,6 @@ $(OPTIONAL_DL_LIBS) \ $(OPTIONAL_INOTIFY_LIBS) if WIN32 -openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h ring_buffer.h +openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h openvpn_LDADD += -lgdi32 -lws2_32 -lwininet -lcrypt32 -liphlpapi -lwinmm -lfwpuclnt -lrpcrt4 -lncrypt -lsetupapi -lbcrypt endif
src/openvpn/dco.c +0 -8
@@ -359,14 +359,6 @@return false; } -if ((o->windows_driver ==WINDOWS_DRIVER_WINTUN ) - || (o->windows_driver ==WINDOWS_DRIVER_TAP_WINDOWS6 )) - { -msg (msglevel,"--windows-driver is set to '%s'. Disabling Data Channel Offload" , -print_tun_backend_driver (o->windows_driver)); -return false; - } -if ((o->mode ==MODE_SERVER ) && o->ce.local_list->len >1 ) {msg (msglevel,"multiple --local options defined, disabling data channel offload" );
src/openvpn/forward.c +7 -61
93 lines not on this page · raw message
src/openvpn/forward.h +2 -36
@@ -360,12 +360,6 @@ { flags |=IOW_TO_TUN ; } -#ifdef _WIN32 -if (tuntap_ring_empty (c->c1.tuntap)) - { - flags &= ~IOW_READ_TUN ; - } -#endif return flags; }
@@ -393,36 +387,8 @@ }else { -#ifdef _WIN32 -bool skip_iowait = flags &IOW_TO_TUN ; -if (flags &IOW_READ_TUN ) - { -/* -* don't read from tun if we have pending write to link, -* since every tun read overwrites to_link buffer filled -* by previous tun read -*/ - skip_iowait = !(flags &IOW_TO_LINK ); - } -if (tuntap_is_wintun (c->c1.tuntap) && skip_iowait) - { -unsigned int ret =0 ; -if (flags &IOW_TO_TUN ) - { - ret |=TUN_WRITE ; - } -if (flags &IOW_READ_TUN ) - { - ret |=TUN_READ ; - } - c->c2.event_set_status = ret; - } - else -#endif /* ifdef _WIN32 */ - { -/* slow path */ -io_wait_dowork (c, flags); - } +/* slow path */ +io_wait_dowork (c, flags); } }
src/openvpn/mudp.c +0 -6
@@ -457,11 +457,5 @@ { flags |=IOW_READ ; } -#ifdef _WIN32 -if (tuntap_ring_empty (m->top.c1.tuntap)) - { - flags &= ~IOW_READ_TUN ; - } -#endif return flags; }
src/openvpn/multi_io.c +0 -14
@@ -190,20 +190,6 @@get_io_flags_udp (&m->top, m->multi_io,p2mp_iow_flags (m)); } -#ifdef _WIN32 -if (tuntap_is_wintun (m->top.c1.tuntap)) - { -if (!tuntap_ring_empty (m->top.c1.tuntap)) - { -/* there is data in wintun ring buffer, read it immediately */ - m->multi_io->esr[0 ].arg =MULTI_IO_TUN ; - m->multi_io->esr[0 ].rwflags =EVENT_READ ; - m->multi_io->n_esr =1 ; -return 1 ; - } - persistent =NULL ; - } -#endif tun_set (m->top.c1.tuntap, m->multi_io->es,EVENT_READ ,MULTI_IO_TUN , persistent);#if defined(ENABLE_DCO ) \ && (defined(TARGET_LINUX ) || defined(TARGET_FREEBSD ) || defined(TARGET_WIN32 ))
src/openvpn/options.c +4 -46
80 lines not on this page · raw message
src/openvpn/ring_buffer.h deleted +0 -125
125 lines not on this page · raw message
src/openvpn/tun.c +5 -156
221 lines not on this page · raw message
src/openvpn/tun.h +1 -149
191 lines not on this page · raw message
src/openvpnserv/CMakeLists.txt +0 -1
@@ -20,7 +20,6 @@ ../tapctl/basic.h ../openvpn/wfp_block.c ../openvpn/wfp_block.h openvpnserv_resources.rc - ../openvpn/ring_buffer.h ) target_compile_options(openvpnserv PRIVATE -D_UNICODE
src/openvpnserv/Makefile.am +1 -2
@@ -36,5 +36,4 @@ service.c service.h \ validate.c validate.h \ $(top_srcdir)/src/openvpn/wfp_block.c $(top_srcdir)/src/openvpn/wfp_block.h \ - openvpnserv_resources.rc \ - $(top_srcdir)/src/openvpn/ring_buffer.h + openvpnserv_resources.rc
src/openvpnserv/interactive.c +0 -151
205 lines not on this page · raw message
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I43ec390040bffeec05270271ea7fb54fb219c536
Gerrit-Change-Number: 1021
Gerrit-PatchSet: 1
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange
Attention is currently required from: flichtenheld, plaisthos.
Hello flichtenheld, plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email
to look at the new patch set (#2).
Change subject: win: remove Wintun support
......................................................................
win: remove Wintun support
Since DCO supports modern ciphers and server mode, there is no reason to support Wintun anymore.
This also removes --windows-driver option support. The default driver is DCO, as it has been since 2.6. If for some reasons one doesn't want to use it, --disable-dco multiplatform option will switch to tap-windows6.
---
M doc/man-sections/vpn-network-options.rst
M doc/man-sections/windows-options.rst
M include/openvpn-msg.h
M src/openvpn/Makefile.am
M src/openvpn/dco.c
M src/openvpn/forward.c
M src/openvpn/forward.h
M src/openvpn/mudp.c
M src/openvpn/multi_io.c
M src/openvpn/options.c
D src/openvpn/ring_buffer.h
M src/openvpn/tun.c
M src/openvpn/tun.h
M src/openvpnmsica/openvpnmsica.c
M src/openvpnmsica/openvpnmsica.h
M src/openvpnserv/CMakeLists.txt
M src/openvpnserv/Makefile.am
M src/openvpnserv/interactive.c
M src/tapctl/main.c
M src/tapctl/tap.h
20 files changed, 26 insertions(+), 792 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/21/1021/2
doc/man-sections/vpn-network-options.rst +1 -2
@@ -137,8 +137,7 @@ Set additional network parameters on supported platforms. May be specified on the client or pushed from the server. On Windows these options are handled by the ``tap-windows6`` driver by default or directly by OpenVPN - if dhcp is disabled or the ``wintun`` driver is in use. The - ``OpenVPN for Android`` client also handles them internally. + if dhcp is disabled. The ``OpenVPN for Android`` client also handles them internally. On all other platforms these options are only saved in the client's environment under the name :code:`foreign_option_{n}` before the
doc/man-sections/windows-options.rst +0 -6
@@ -252,9 +252,3 @@ otherwise it defaulted to :code:`C:\\WINDOWS`. It is not needed to use the ``env`` keyword any more, and it will just be ignored. A warning is logged when this is found in the configuration file. - ---windows-driver drv - Specifies which tun driver to use. Values are :code:`ovpn-dco` (default), - :code:`tap-windows6` and :code:`wintun`. :code:`ovpn-dco` and :code:`wintun` - require ``--dev tun``. :code:`wintun` also requires OpenVPN process to run - elevated, or be invoked using the Interactive Service.
include/openvpn-msg.h +0 -10
@@ -44,7 +44,6 @@ msg_del_wfp_block, msg_register_dns, msg_enable_dhcp, - msg_register_ring_buffers, msg_set_mtu, msg_add_wins_cfg, msg_del_wins_cfg
@@ -158,15 +157,6 @@ typedef struct { message_header_t header; -HANDLE device; -HANDLE send_ring_handle; -HANDLE receive_ring_handle; -HANDLE send_tail_moved; -HANDLE receive_tail_moved; -}register_ring_buffers_message_t ; - -typedef struct { - message_header_t header; interface_t iface; short family; int mtu;
src/openvpn/Makefile.am +1 -1
@@ -163,6 +163,6 @@ $(OPTIONAL_DL_LIBS) \ $(OPTIONAL_INOTIFY_LIBS) if WIN32 -openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h ring_buffer.h +openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h openvpn_LDADD += -lgdi32 -lws2_32 -lwininet -lcrypt32 -liphlpapi -lwinmm -lfwpuclnt -lrpcrt4 -lncrypt -lsetupapi -lbcrypt endif
src/openvpn/dco.c +0 -8
@@ -359,14 +359,6 @@return false; } -if ((o->windows_driver ==WINDOWS_DRIVER_WINTUN ) - || (o->windows_driver ==WINDOWS_DRIVER_TAP_WINDOWS6 )) - { -msg (msglevel,"--windows-driver is set to '%s'. Disabling Data Channel Offload" , -print_tun_backend_driver (o->windows_driver)); -return false; - } -if ((o->mode ==MODE_SERVER ) && o->ce.local_list->len >1 ) {msg (msglevel,"multiple --local options defined, disabling data channel offload" );
src/openvpn/forward.c +7 -61
93 lines not on this page · raw message
src/openvpn/forward.h +2 -36
@@ -360,12 +360,6 @@ { flags |=IOW_TO_TUN ; } -#ifdef _WIN32 -if (tuntap_ring_empty (c->c1.tuntap)) - { - flags &= ~IOW_READ_TUN ; - } -#endif return flags; }
@@ -393,36 +387,8 @@ }else { -#ifdef _WIN32 -bool skip_iowait = flags &IOW_TO_TUN ; -if (flags &IOW_READ_TUN ) - { -/* -* don't read from tun if we have pending write to link, -* since every tun read overwrites to_link buffer filled -* by previous tun read -*/ - skip_iowait = !(flags &IOW_TO_LINK ); - } -if (tuntap_is_wintun (c->c1.tuntap) && skip_iowait) - { -unsigned int ret =0 ; -if (flags &IOW_TO_TUN ) - { - ret |=TUN_WRITE ; - } -if (flags &IOW_READ_TUN ) - { - ret |=TUN_READ ; - } - c->c2.event_set_status = ret; - } - else -#endif /* ifdef _WIN32 */ - { -/* slow path */ -io_wait_dowork (c, flags); - } +/* slow path */ +io_wait_dowork (c, flags); } }
src/openvpn/mudp.c +0 -6
@@ -457,11 +457,5 @@ { flags |=IOW_READ ; } -#ifdef _WIN32 -if (tuntap_ring_empty (m->top.c1.tuntap)) - { - flags &= ~IOW_READ_TUN ; - } -#endif return flags; }
src/openvpn/multi_io.c +0 -14
@@ -190,20 +190,6 @@get_io_flags_udp (&m->top, m->multi_io,p2mp_iow_flags (m)); } -#ifdef _WIN32 -if (tuntap_is_wintun (m->top.c1.tuntap)) - { -if (!tuntap_ring_empty (m->top.c1.tuntap)) - { -/* there is data in wintun ring buffer, read it immediately */ - m->multi_io->esr[0 ].arg =MULTI_IO_TUN ; - m->multi_io->esr[0 ].rwflags =EVENT_READ ; - m->multi_io->n_esr =1 ; -return 1 ; - } - persistent =NULL ; - } -#endif tun_set (m->top.c1.tuntap, m->multi_io->es,EVENT_READ ,MULTI_IO_TUN , persistent);#if defined(ENABLE_DCO ) \ && (defined(TARGET_LINUX ) || defined(TARGET_FREEBSD ) || defined(TARGET_WIN32 ))
src/openvpn/options.c +4 -46
80 lines not on this page · raw message
src/openvpn/ring_buffer.h deleted +0 -125
125 lines not on this page · raw message
src/openvpn/tun.c +5 -156
221 lines not on this page · raw message
src/openvpn/tun.h +1 -149
191 lines not on this page · raw message
src/openvpnmsica/openvpnmsica.c +0 -5
@@ -320,11 +320,6 @@ L"ACTIVETAPWINDOWS6ADAPTERS");find_adapters ( hInstall, -L"Wintun" L"\0" , -L"WINTUNADAPTERS" , -L"ACTIVEWINTUNADAPTERS" ); -find_adapters ( - hInstall,L"ovpn-dco" L"\0" ,L"OVPNDCOADAPTERS" ,L"ACTIVEOVPNDCOADAPTERS" );
src/openvpnmsica/openvpnmsica.h +0 -4
@@ -88,10 +88,6 @@* ACTIVETAPWINDOWS6ADAPTERS properties with semicolon delimited list of all installed adapter * GUIDs and active adapter GUIDs respectively. * -* - Finds existing Wintun adapters and set WINTUNADAPTERS and ACTIVEWINTUNADAPTERS properties -* with semicolon delimited list of all installed adapter GUIDs and active adapter GUIDs -* respectively. -* * - Finds existing ovpn-dco adapters and set OVPNDCOADAPTERS and ACTIVEOVPNDCOADAPTERS properties * with semicolon delimited list of all installed adapter GUIDs and active adapter GUIDs * respectively.
src/openvpnserv/CMakeLists.txt +0 -1
@@ -20,7 +20,6 @@ ../tapctl/basic.h ../openvpn/wfp_block.c ../openvpn/wfp_block.h openvpnserv_resources.rc - ../openvpn/ring_buffer.h ) target_compile_options(openvpnserv PRIVATE -D_UNICODE
src/openvpnserv/Makefile.am +1 -2
@@ -36,5 +36,4 @@ service.c service.h \ validate.c validate.h \ $(top_srcdir)/src/openvpn/wfp_block.c $(top_srcdir)/src/openvpn/wfp_block.h \ - openvpnserv_resources.rc \ - $(top_srcdir)/src/openvpn/ring_buffer.h + openvpnserv_resources.rc
src/openvpnserv/interactive.c +0 -151
205 lines not on this page · raw message
src/tapctl/main.c +3 -8
@@ -75,8 +75,8 @@L" Note: This name can also be specified as OpenVPN's --dev-node \n" L" option. \n" L"--hwid <hwid> Adapter hardware ID. Default value is root\\tap0901, which \n" -L" describes tap-windows6 driver. To work with wintun or ovpn-dco \n" -L" driver, specify 'wintun' or 'ovpn-dco'. \n" +L" describes tap-windows6 driver. To work with ovpn-dco driver, \n" +L" driver, specify 'ovpn-dco'. \n" L"\n" L"Output:\n" L"\n"
@@ -94,7 +94,7 @@L"\n" L"Options:\n" L"\n" -L"--hwid <hwid> Adapter hardware ID. By default, root\\tap0901, tap0901, wintun and \n" +L"--hwid <hwid> Adapter hardware ID. By default, root\\tap0901, tap0901 and \n" L" ovpn-dco adapters are listed. Use this switch to limit the list.\n" L"\n" L"Output:\n"
@@ -167,10 +167,6 @@ { base_name =L"OpenVPN Data Channel Offload" ; } - else if (wcsicmp(hwid, L"wintun") == 0) - { - base_name =L"OpenVPN Wintun" ; - } else if (wcsicmp(hwid, L"root\\" _L(TAP_WIN_COMPONENT_ID)) == 0) { base_name =L"OpenVPN TAP-Windows6" ;
@@ -351,7 +347,6 @@WCHAR szzHwId[0x100 ] = L"root\\" _L(TAP_WIN_COMPONENT_ID) L"\0" _L(TAP_WIN_COMPONENT_ID) L"\0" -L"Wintun\0" L"ovpn-dco\0" ;/* Parse options. */
src/tapctl/tap.h +1 -1
@@ -38,7 +38,7 @@* description of the device. This pointer is optional and can be NULL. * * @param szHwId A pointer to a NULL-terminated string that supplies the hardware id -* of the device (e.g. "root\\tap0901", "Wintun"). +* of the device (e.g. "root\\tap0901"). * * @param pbRebootRequired A pointer to a BOOL flag. If the device requires a system restart, * this flag is set to TRUE. Otherwise, the flag is left unmodified. This
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I43ec390040bffeec05270271ea7fb54fb219c536
Gerrit-Change-Number: 1021
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newpatchset
Attention is currently required from: flichtenheld, plaisthos, stipa.
cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email )
Change subject: win: remove Wintun support
......................................................................
Patch Set 2: Code-Review+1
(4 comments)
Patchset:
PS2:
I like this - so much code and special cases going out :-) - one comment, two questions remain
File include/openvpn-msg.h:
http://gerrit.openvpn.net/c/openvpn/+/1021/comment/6f74688f_234eb585 :
PS2, Line 47: msg_register_ring_buffers,
I am a bit worried about taking out message number enums, leading to testing challenges when having openvpn.exe talking to an iservice that is from a different build version (this might not affect anyone but me, but I usually just build an openvpn.exe and use "the rest" from a regular .msi install)
File src/openvpn/forward.h:
http://gerrit.openvpn.net/c/openvpn/+/1021/comment/1d13e680_6724da03 :
PS2, Line 406: }
is that related to wintun? ("it does not say so, and I'm not aware of the origins of this code")
File src/openvpn/forward.c:
http://gerrit.openvpn.net/c/openvpn/+/1021/comment/bd5e03db_47c6ab5d :
PS2, Line 2230: }
this is similar to the thing in forward.h - is this related to wintun particulars, or "windows read/write" in general?
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I43ec390040bffeec05270271ea7fb54fb219c536
Gerrit-Change-Number: 1021
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Gerrit-Comment-Date: Tue, 13 May 2025 13:40:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: cron2, flichtenheld, plaisthos, stipa.
Hello cron2, flichtenheld, plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email
to look at the new patch set (#3).
The following approvals got outdated and were removed:
Code-Review+1 by cron2
Change subject: win: remove Wintun support
......................................................................
win: remove Wintun support
Since DCO supports modern ciphers and server mode, there is no reason to support Wintun anymore.
This also removes --windows-driver option support. The default driver is DCO, as it has been since 2.6. If for some reasons one doesn't want to use it, --disable-dco multiplatform option will switch to tap-windows6.
---
M doc/man-sections/vpn-network-options.rst
M doc/man-sections/windows-options.rst
M include/openvpn-msg.h
M src/openvpn/Makefile.am
M src/openvpn/dco.c
M src/openvpn/forward.c
M src/openvpn/forward.h
M src/openvpn/mudp.c
M src/openvpn/multi_io.c
M src/openvpn/options.c
D src/openvpn/ring_buffer.h
M src/openvpn/tun.c
M src/openvpn/tun.h
M src/openvpnmsica/openvpnmsica.c
M src/openvpnmsica/openvpnmsica.h
M src/openvpnserv/CMakeLists.txt
M src/openvpnserv/Makefile.am
M src/openvpnserv/interactive.c
M src/tapctl/main.c
M src/tapctl/tap.h
20 files changed, 27 insertions(+), 792 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/21/1021/3
doc/man-sections/vpn-network-options.rst +1 -2
@@ -137,8 +137,7 @@ Set additional network parameters on supported platforms. May be specified on the client or pushed from the server. On Windows these options are handled by the ``tap-windows6`` driver by default or directly by OpenVPN - if dhcp is disabled or the ``wintun`` driver is in use. The - ``OpenVPN for Android`` client also handles them internally. + if dhcp is disabled. The ``OpenVPN for Android`` client also handles them internally. On all other platforms these options are only saved in the client's environment under the name :code:`foreign_option_{n}` before the
doc/man-sections/windows-options.rst +0 -6
@@ -252,9 +252,3 @@ otherwise it defaulted to :code:`C:\\WINDOWS`. It is not needed to use the ``env`` keyword any more, and it will just be ignored. A warning is logged when this is found in the configuration file. - ---windows-driver drv - Specifies which tun driver to use. Values are :code:`ovpn-dco` (default), - :code:`tap-windows6` and :code:`wintun`. :code:`ovpn-dco` and :code:`wintun` - require ``--dev tun``. :code:`wintun` also requires OpenVPN process to run - elevated, or be invoked using the Interactive Service.
include/openvpn-msg.h +1 -10
@@ -44,7 +44,7 @@ msg_del_wfp_block, msg_register_dns, msg_enable_dhcp, - msg_register_ring_buffers, + deprecated_msg_register_ring_buffers, msg_set_mtu, msg_add_wins_cfg, msg_del_wins_cfg
@@ -158,15 +158,6 @@ typedef struct { message_header_t header; -HANDLE device; -HANDLE send_ring_handle; -HANDLE receive_ring_handle; -HANDLE send_tail_moved; -HANDLE receive_tail_moved; -}register_ring_buffers_message_t ; - -typedef struct { - message_header_t header; interface_t iface; short family; int mtu;
src/openvpn/Makefile.am +1 -1
@@ -163,6 +163,6 @@ $(OPTIONAL_DL_LIBS) \ $(OPTIONAL_INOTIFY_LIBS) if WIN32 -openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h ring_buffer.h +openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h openvpn_LDADD += -lgdi32 -lws2_32 -lwininet -lcrypt32 -liphlpapi -lwinmm -lfwpuclnt -lrpcrt4 -lncrypt -lsetupapi -lbcrypt endif
src/openvpn/dco.c +0 -8
@@ -359,14 +359,6 @@return false; } -if ((o->windows_driver ==WINDOWS_DRIVER_WINTUN ) - || (o->windows_driver ==WINDOWS_DRIVER_TAP_WINDOWS6 )) - { -msg (msglevel,"--windows-driver is set to '%s'. Disabling Data Channel Offload" , -print_tun_backend_driver (o->windows_driver)); -return false; - } -if ((o->mode ==MODE_SERVER ) && o->ce.local_list->len >1 ) {msg (msglevel,"multiple --local options defined, disabling data channel offload" );
src/openvpn/forward.c +7 -61
93 lines not on this page · raw message
src/openvpn/forward.h +2 -36
@@ -360,12 +360,6 @@ { flags |=IOW_TO_TUN ; } -#ifdef _WIN32 -if (tuntap_ring_empty (c->c1.tuntap)) - { - flags &= ~IOW_READ_TUN ; - } -#endif return flags; }
@@ -393,36 +387,8 @@ }else { -#ifdef _WIN32 -bool skip_iowait = flags &IOW_TO_TUN ; -if (flags &IOW_READ_TUN ) - { -/* -* don't read from tun if we have pending write to link, -* since every tun read overwrites to_link buffer filled -* by previous tun read -*/ - skip_iowait = !(flags &IOW_TO_LINK ); - } -if (tuntap_is_wintun (c->c1.tuntap) && skip_iowait) - { -unsigned int ret =0 ; -if (flags &IOW_TO_TUN ) - { - ret |=TUN_WRITE ; - } -if (flags &IOW_READ_TUN ) - { - ret |=TUN_READ ; - } - c->c2.event_set_status = ret; - } - else -#endif /* ifdef _WIN32 */ - { -/* slow path */ -io_wait_dowork (c, flags); - } +/* slow path */ +io_wait_dowork (c, flags); } }
src/openvpn/mudp.c +0 -6
@@ -457,11 +457,5 @@ { flags |=IOW_READ ; } -#ifdef _WIN32 -if (tuntap_ring_empty (m->top.c1.tuntap)) - { - flags &= ~IOW_READ_TUN ; - } -#endif return flags; }
src/openvpn/multi_io.c +0 -14
@@ -190,20 +190,6 @@get_io_flags_udp (&m->top, m->multi_io,p2mp_iow_flags (m)); } -#ifdef _WIN32 -if (tuntap_is_wintun (m->top.c1.tuntap)) - { -if (!tuntap_ring_empty (m->top.c1.tuntap)) - { -/* there is data in wintun ring buffer, read it immediately */ - m->multi_io->esr[0 ].arg =MULTI_IO_TUN ; - m->multi_io->esr[0 ].rwflags =EVENT_READ ; - m->multi_io->n_esr =1 ; -return 1 ; - } - persistent =NULL ; - } -#endif tun_set (m->top.c1.tuntap, m->multi_io->es,EVENT_READ ,MULTI_IO_TUN , persistent);#if defined(ENABLE_DCO ) \ && (defined(TARGET_LINUX ) || defined(TARGET_FREEBSD ) || defined(TARGET_WIN32 ))
src/openvpn/options.c +4 -46
80 lines not on this page · raw message
src/openvpn/ring_buffer.h deleted +0 -125
125 lines not on this page · raw message
src/openvpn/tun.c +5 -156
221 lines not on this page · raw message
src/openvpn/tun.h +1 -149
191 lines not on this page · raw message
src/openvpnmsica/openvpnmsica.c +0 -5
@@ -320,11 +320,6 @@ L"ACTIVETAPWINDOWS6ADAPTERS");find_adapters ( hInstall, -L"Wintun" L"\0" , -L"WINTUNADAPTERS" , -L"ACTIVEWINTUNADAPTERS" ); -find_adapters ( - hInstall,L"ovpn-dco" L"\0" ,L"OVPNDCOADAPTERS" ,L"ACTIVEOVPNDCOADAPTERS" );
src/openvpnmsica/openvpnmsica.h +0 -4
@@ -88,10 +88,6 @@* ACTIVETAPWINDOWS6ADAPTERS properties with semicolon delimited list of all installed adapter * GUIDs and active adapter GUIDs respectively. * -* - Finds existing Wintun adapters and set WINTUNADAPTERS and ACTIVEWINTUNADAPTERS properties -* with semicolon delimited list of all installed adapter GUIDs and active adapter GUIDs -* respectively. -* * - Finds existing ovpn-dco adapters and set OVPNDCOADAPTERS and ACTIVEOVPNDCOADAPTERS properties * with semicolon delimited list of all installed adapter GUIDs and active adapter GUIDs * respectively.
src/openvpnserv/CMakeLists.txt +0 -1
@@ -20,7 +20,6 @@ ../tapctl/basic.h ../openvpn/wfp_block.c ../openvpn/wfp_block.h openvpnserv_resources.rc - ../openvpn/ring_buffer.h ) target_compile_options(openvpnserv PRIVATE -D_UNICODE
src/openvpnserv/Makefile.am +1 -2
@@ -36,5 +36,4 @@ service.c service.h \ validate.c validate.h \ $(top_srcdir)/src/openvpn/wfp_block.c $(top_srcdir)/src/openvpn/wfp_block.h \ - openvpnserv_resources.rc \ - $(top_srcdir)/src/openvpn/ring_buffer.h + openvpnserv_resources.rc
src/openvpnserv/interactive.c +0 -151
205 lines not on this page · raw message
src/tapctl/main.c +3 -8
@@ -75,8 +75,8 @@L" Note: This name can also be specified as OpenVPN's --dev-node \n" L" option. \n" L"--hwid <hwid> Adapter hardware ID. Default value is root\\tap0901, which \n" -L" describes tap-windows6 driver. To work with wintun or ovpn-dco \n" -L" driver, specify 'wintun' or 'ovpn-dco'. \n" +L" describes tap-windows6 driver. To work with ovpn-dco driver, \n" +L" driver, specify 'ovpn-dco'. \n" L"\n" L"Output:\n" L"\n"
@@ -94,7 +94,7 @@L"\n" L"Options:\n" L"\n" -L"--hwid <hwid> Adapter hardware ID. By default, root\\tap0901, tap0901, wintun and \n" +L"--hwid <hwid> Adapter hardware ID. By default, root\\tap0901, tap0901 and \n" L" ovpn-dco adapters are listed. Use this switch to limit the list.\n" L"\n" L"Output:\n"
@@ -167,10 +167,6 @@ { base_name =L"OpenVPN Data Channel Offload" ; } - else if (wcsicmp(hwid, L"wintun") == 0) - { - base_name =L"OpenVPN Wintun" ; - } else if (wcsicmp(hwid, L"root\\" _L(TAP_WIN_COMPONENT_ID)) == 0) { base_name =L"OpenVPN TAP-Windows6" ;
@@ -351,7 +347,6 @@WCHAR szzHwId[0x100 ] = L"root\\" _L(TAP_WIN_COMPONENT_ID) L"\0" _L(TAP_WIN_COMPONENT_ID) L"\0" -L"Wintun\0" L"ovpn-dco\0" ;/* Parse options. */
src/tapctl/tap.h +1 -1
@@ -38,7 +38,7 @@* description of the device. This pointer is optional and can be NULL. * * @param szHwId A pointer to a NULL-terminated string that supplies the hardware id -* of the device (e.g. "root\\tap0901", "Wintun"). +* of the device (e.g. "root\\tap0901"). * * @param pbRebootRequired A pointer to a BOOL flag. If the device requires a system restart, * this flag is set to TRUE. Otherwise, the flag is left unmodified. This
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I43ec390040bffeec05270271ea7fb54fb219c536
Gerrit-Change-Number: 1021
Gerrit-PatchSet: 3
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Gerrit-MessageType: newpatchset
Attention is currently required from: cron2, flichtenheld, plaisthos.
stipa has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email )
Change subject: win: remove Wintun support
......................................................................
Patch Set 2:
(3 comments)
File include/openvpn-msg.h:
http://gerrit.openvpn.net/c/openvpn/+/1021/comment/8f9f9442_c5569e1b :
PS2, Line 47: msg_register_ring_buffers,
Quoted 1 line
I am a bit worried about taking out message number enums, leading to testing challenges when having […]
Done
File src/openvpn/forward.h:
http://gerrit.openvpn.net/c/openvpn/+/1021/comment/0d807ff9_8c3bd023 :
PS2, Line 406: }
Quoted 1 line
is that related to wintun? ("it does not say so, and I'm not aware of the origins of this code")
Yes, this is from "wintun: ring buffers based I/O" patch
File src/openvpn/forward.c:
http://gerrit.openvpn.net/c/openvpn/+/1021/comment/ab5875dc_3a7846ca :
PS2, Line 2230: }
Quoted 1 line
this is similar to the thing in `forward. […]
This is from "wintun: ring buffers based I/O" patch
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I43ec390040bffeec05270271ea7fb54fb219c536
Gerrit-Change-Number: 1021
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Tue, 13 May 2025 14:25:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: cron2 <[email protected]...>
Gerrit-MessageType: comment
Attention is currently required from: flichtenheld, plaisthos, stipa.
cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email )
Change subject: win: remove Wintun support
......................................................................
Patch Set 3: Code-Review+2
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I43ec390040bffeec05270271ea7fb54fb219c536
Gerrit-Change-Number: 1021
Gerrit-PatchSet: 3
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Gerrit-Comment-Date: Tue, 13 May 2025 14:26:19 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
PATCH v3 1/1 win: remove Wintun support
In reply to a message not in the archiveFrom: Lev Stipakov <[email protected]...>
Since DCO supports modern ciphers and server mode, there is no reason to support Wintun anymore.
This also removes --windows-driver option support. The default driver is DCO, as it has been since 2.6. If for some reasons one doesn't want to use it, --disable-dco multiplatform option will switch to tap-windows6.
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1021
This mail reflects revision 3 of this Change.
Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>
doc/man-sections/vpn-network-options.rst +1 -2
@@ -137,8 +137,7 @@ Set additional network parameters on supported platforms. May be specified on the client or pushed from the server. On Windows these options are handled by the ``tap-windows6`` driver by default or directly by OpenVPN - if dhcp is disabled or the ``wintun`` driver is in use. The - ``OpenVPN for Android`` client also handles them internally. + if dhcp is disabled. The ``OpenVPN for Android`` client also handles them internally. On all other platforms these options are only saved in the client's environment under the name :code:`foreign_option_{n}` before the
doc/man-sections/windows-options.rst +0 -6
@@ -252,9 +252,3 @@ otherwise it defaulted to :code:`C:\\WINDOWS`. It is not needed to use the ``env`` keyword any more, and it will just be ignored. A warning is logged when this is found in the configuration file. - ---windows-driver drv - Specifies which tun driver to use. Values are :code:`ovpn-dco` (default), - :code:`tap-windows6` and :code:`wintun`. :code:`ovpn-dco` and :code:`wintun` - require ``--dev tun``. :code:`wintun` also requires OpenVPN process to run - elevated, or be invoked using the Interactive Service.
include/openvpn-msg.h +1 -10
@@ -44,7 +44,7 @@ msg_del_wfp_block, msg_register_dns, msg_enable_dhcp, - msg_register_ring_buffers, + deprecated_msg_register_ring_buffers, msg_set_mtu, msg_add_wins_cfg, msg_del_wins_cfg
@@ -158,15 +158,6 @@ typedef struct { message_header_t header; -HANDLE device; -HANDLE send_ring_handle; -HANDLE receive_ring_handle; -HANDLE send_tail_moved; -HANDLE receive_tail_moved; -}register_ring_buffers_message_t ; - -typedef struct { - message_header_t header; interface_t iface; short family; int mtu;
src/openvpn/Makefile.am +1 -1
@@ -163,6 +163,6 @@ $(OPTIONAL_DL_LIBS) \ $(OPTIONAL_INOTIFY_LIBS) if WIN32 -openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h ring_buffer.h +openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h openvpn_LDADD += -lgdi32 -lws2_32 -lwininet -lcrypt32 -liphlpapi -lwinmm -lfwpuclnt -lrpcrt4 -lncrypt -lsetupapi -lbcrypt endif
src/openvpn/dco.c +0 -8
@@ -359,14 +359,6 @@return false; } -if ((o->windows_driver ==WINDOWS_DRIVER_WINTUN ) - || (o->windows_driver ==WINDOWS_DRIVER_TAP_WINDOWS6 )) - { -msg (msglevel,"--windows-driver is set to '%s'. Disabling Data Channel Offload" , -print_tun_backend_driver (o->windows_driver)); -return false; - } -if ((o->mode ==MODE_SERVER ) && o->ce.local_list->len >1 ) {msg (msglevel,"multiple --local options defined, disabling data channel offload" );
src/openvpn/forward.c +7 -61
93 lines not on this page · raw message
src/openvpn/forward.h +2 -36
@@ -360,12 +360,6 @@ { flags |=IOW_TO_TUN ; } -#ifdef _WIN32 -if (tuntap_ring_empty (c->c1.tuntap)) - { - flags &= ~IOW_READ_TUN ; - } -#endif return flags; }
@@ -393,36 +387,8 @@ }else { -#ifdef _WIN32 -bool skip_iowait = flags &IOW_TO_TUN ; -if (flags &IOW_READ_TUN ) - { -/* -* don't read from tun if we have pending write to link, -* since every tun read overwrites to_link buffer filled -* by previous tun read -*/ - skip_iowait = !(flags &IOW_TO_LINK ); - } -if (tuntap_is_wintun (c->c1.tuntap) && skip_iowait) - { -unsigned int ret =0 ; -if (flags &IOW_TO_TUN ) - { - ret |=TUN_WRITE ; - } -if (flags &IOW_READ_TUN ) - { - ret |=TUN_READ ; - } - c->c2.event_set_status = ret; - } - else -#endif /* ifdef _WIN32 */ - { -/* slow path */ -io_wait_dowork (c, flags); - } +/* slow path */ +io_wait_dowork (c, flags); } }
src/openvpn/mudp.c +0 -6
@@ -457,11 +457,5 @@ { flags |=IOW_READ ; } -#ifdef _WIN32 -if (tuntap_ring_empty (m->top.c1.tuntap)) - { - flags &= ~IOW_READ_TUN ; - } -#endif return flags; }
src/openvpn/multi_io.c +0 -14
@@ -190,20 +190,6 @@get_io_flags_udp (&m->top, m->multi_io,p2mp_iow_flags (m)); } -#ifdef _WIN32 -if (tuntap_is_wintun (m->top.c1.tuntap)) - { -if (!tuntap_ring_empty (m->top.c1.tuntap)) - { -/* there is data in wintun ring buffer, read it immediately */ - m->multi_io->esr[0 ].arg =MULTI_IO_TUN ; - m->multi_io->esr[0 ].rwflags =EVENT_READ ; - m->multi_io->n_esr =1 ; -return 1 ; - } - persistent =NULL ; - } -#endif tun_set (m->top.c1.tuntap, m->multi_io->es,EVENT_READ ,MULTI_IO_TUN , persistent);#if defined(ENABLE_DCO ) \ && (defined(TARGET_LINUX ) || defined(TARGET_FREEBSD ) || defined(TARGET_WIN32 ))
src/openvpn/options.c +4 -46
80 lines not on this page · raw message
src/openvpn/ring_buffer.h deleted +0 -125
125 lines not on this page · raw message
src/openvpn/tun.c +5 -156
221 lines not on this page · raw message
src/openvpn/tun.h +1 -149
191 lines not on this page · raw message
src/openvpnmsica/openvpnmsica.c +0 -5
@@ -320,11 +320,6 @@ L"ACTIVETAPWINDOWS6ADAPTERS");find_adapters ( hInstall, -L"Wintun" L"\0" , -L"WINTUNADAPTERS" , -L"ACTIVEWINTUNADAPTERS" ); -find_adapters ( - hInstall,L"ovpn-dco" L"\0" ,L"OVPNDCOADAPTERS" ,L"ACTIVEOVPNDCOADAPTERS" );
src/openvpnmsica/openvpnmsica.h +0 -4
@@ -88,10 +88,6 @@* ACTIVETAPWINDOWS6ADAPTERS properties with semicolon delimited list of all installed adapter * GUIDs and active adapter GUIDs respectively. * -* - Finds existing Wintun adapters and set WINTUNADAPTERS and ACTIVEWINTUNADAPTERS properties -* with semicolon delimited list of all installed adapter GUIDs and active adapter GUIDs -* respectively. -* * - Finds existing ovpn-dco adapters and set OVPNDCOADAPTERS and ACTIVEOVPNDCOADAPTERS properties * with semicolon delimited list of all installed adapter GUIDs and active adapter GUIDs * respectively.
src/openvpnserv/CMakeLists.txt +0 -1
@@ -20,7 +20,6 @@ ../tapctl/basic.h ../openvpn/wfp_block.c ../openvpn/wfp_block.h openvpnserv_resources.rc - ../openvpn/ring_buffer.h ) target_compile_options(openvpnserv PRIVATE -D_UNICODE
src/openvpnserv/Makefile.am +1 -2
@@ -36,5 +36,4 @@ service.c service.h \ validate.c validate.h \ $(top_srcdir)/src/openvpn/wfp_block.c $(top_srcdir)/src/openvpn/wfp_block.h \ - openvpnserv_resources.rc \ - $(top_srcdir)/src/openvpn/ring_buffer.h + openvpnserv_resources.rc
src/openvpnserv/interactive.c +0 -151
205 lines not on this page · raw message
src/tapctl/main.c +3 -8
@@ -75,8 +75,8 @@L" Note: This name can also be specified as OpenVPN's --dev-node \n" L" option. \n" L"--hwid <hwid> Adapter hardware ID. Default value is root\\tap0901, which \n" -L" describes tap-windows6 driver. To work with wintun or ovpn-dco \n" -L" driver, specify 'wintun' or 'ovpn-dco'. \n" +L" describes tap-windows6 driver. To work with ovpn-dco driver, \n" +L" driver, specify 'ovpn-dco'. \n" L"\n" L"Output:\n" L"\n"
@@ -94,7 +94,7 @@L"\n" L"Options:\n" L"\n" -L"--hwid <hwid> Adapter hardware ID. By default, root\\tap0901, tap0901, wintun and \n" +L"--hwid <hwid> Adapter hardware ID. By default, root\\tap0901, tap0901 and \n" L" ovpn-dco adapters are listed. Use this switch to limit the list.\n" L"\n" L"Output:\n"
@@ -167,10 +167,6 @@ { base_name =L"OpenVPN Data Channel Offload" ; } - else if (wcsicmp(hwid, L"wintun") == 0) - { - base_name =L"OpenVPN Wintun" ; - } else if (wcsicmp(hwid, L"root\\" _L(TAP_WIN_COMPONENT_ID)) == 0) { base_name =L"OpenVPN TAP-Windows6" ;
@@ -351,7 +347,6 @@WCHAR szzHwId[0x100 ] = L"root\\" _L(TAP_WIN_COMPONENT_ID) L"\0" _L(TAP_WIN_COMPONENT_ID) L"\0" -L"Wintun\0" L"ovpn-dco\0" ;/* Parse options. */
src/tapctl/tap.h +1 -1
@@ -38,7 +38,7 @@* description of the device. This pointer is optional and can be NULL. * * @param szHwId A pointer to a NULL-terminated string that supplies the hardware id -* of the device (e.g. "root\\tap0901", "Wintun"). +* of the device (e.g. "root\\tap0901"). * * @param pbRebootRequired A pointer to a BOOL flag. If the device requires a system restart, * this flag is set to TRUE. Otherwise, the flag is left unmodified. This
PATCH v4 1/1 win: remove Wintun support
In reply to a message not in the archiveFrom: Lev Stipakov <[email protected]...>
Since DCO supports modern ciphers and server mode, there is no reason to support Wintun anymore.
This also removes --windows-driver option support. The default driver is DCO, as it has been since 2.6. If for some reasons one doesn't want to use it, --disable-dco multiplatform option will switch to tap-windows6.
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1021
This mail reflects revision 4 of this Change.
Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>
doc/man-sections/vpn-network-options.rst +1 -2
@@ -137,8 +137,7 @@ Set additional network parameters on supported platforms. May be specified on the client or pushed from the server. On Windows these options are handled by the ``tap-windows6`` driver by default or directly by OpenVPN - if dhcp is disabled or the ``wintun`` driver is in use. The - ``OpenVPN for Android`` client also handles them internally. + if dhcp is disabled. The ``OpenVPN for Android`` client also handles them internally. On all other platforms these options are only saved in the client's environment under the name :code:`foreign_option_{n}` before the
doc/man-sections/windows-options.rst +0 -6
@@ -252,9 +252,3 @@ otherwise it defaulted to :code:`C:\\WINDOWS`. It is not needed to use the ``env`` keyword any more, and it will just be ignored. A warning is logged when this is found in the configuration file. - ---windows-driver drv - Specifies which tun driver to use. Values are :code:`ovpn-dco` (default), - :code:`tap-windows6` and :code:`wintun`. :code:`ovpn-dco` and :code:`wintun` - require ``--dev tun``. :code:`wintun` also requires OpenVPN process to run - elevated, or be invoked using the Interactive Service.
include/openvpn-msg.h +1 -10
@@ -44,7 +44,7 @@ msg_del_wfp_block, msg_register_dns, msg_enable_dhcp, - msg_register_ring_buffers, + deprecated_msg_register_ring_buffers, msg_set_mtu, msg_add_wins_cfg, msg_del_wins_cfg,
@@ -159,15 +159,6 @@ typedef struct { message_header_t header; -HANDLE device; -HANDLE send_ring_handle; -HANDLE receive_ring_handle; -HANDLE send_tail_moved; -HANDLE receive_tail_moved; -}register_ring_buffers_message_t ; - -typedef struct { - message_header_t header; interface_t iface; short family; int mtu;
src/openvpn/Makefile.am +1 -1
@@ -163,6 +163,6 @@ $(OPTIONAL_DL_LIBS) \ $(OPTIONAL_INOTIFY_LIBS) if WIN32 -openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h ring_buffer.h +openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h openvpn_LDADD += -lgdi32 -lws2_32 -lwininet -lcrypt32 -liphlpapi -lwinmm -lfwpuclnt -lrpcrt4 -lncrypt -lsetupapi -lbcrypt endif
src/openvpn/dco.c +0 -8
@@ -359,14 +359,6 @@return false; } -if ((o->windows_driver ==WINDOWS_DRIVER_WINTUN ) - || (o->windows_driver ==WINDOWS_DRIVER_TAP_WINDOWS6 )) - { -msg (msglevel,"--windows-driver is set to '%s'. Disabling Data Channel Offload" , -print_tun_backend_driver (o->windows_driver)); -return false; - } -if ((o->mode ==MODE_SERVER ) && o->ce.local_list->len >1 ) {msg (msglevel,"multiple --local options defined, disabling data channel offload" );
src/openvpn/forward.c +7 -61
93 lines not on this page · raw message
src/openvpn/forward.h +2 -36
@@ -360,12 +360,6 @@ { flags |=IOW_TO_TUN ; } -#ifdef _WIN32 -if (tuntap_ring_empty (c->c1.tuntap)) - { - flags &= ~IOW_READ_TUN ; - } -#endif return flags; }
@@ -393,36 +387,8 @@ }else { -#ifdef _WIN32 -bool skip_iowait = flags &IOW_TO_TUN ; -if (flags &IOW_READ_TUN ) - { -/* -* don't read from tun if we have pending write to link, -* since every tun read overwrites to_link buffer filled -* by previous tun read -*/ - skip_iowait = !(flags &IOW_TO_LINK ); - } -if (tuntap_is_wintun (c->c1.tuntap) && skip_iowait) - { -unsigned int ret =0 ; -if (flags &IOW_TO_TUN ) - { - ret |=TUN_WRITE ; - } -if (flags &IOW_READ_TUN ) - { - ret |=TUN_READ ; - } - c->c2.event_set_status = ret; - } - else -#endif /* ifdef _WIN32 */ - { -/* slow path */ -io_wait_dowork (c, flags); - } +/* slow path */ +io_wait_dowork (c, flags); } }
src/openvpn/mudp.c +0 -6
@@ -457,11 +457,5 @@ { flags |=IOW_READ ; } -#ifdef _WIN32 -if (tuntap_ring_empty (m->top.c1.tuntap)) - { - flags &= ~IOW_READ_TUN ; - } -#endif return flags; }
src/openvpn/multi_io.c +0 -14
@@ -190,20 +190,6 @@get_io_flags_udp (&m->top, m->multi_io,p2mp_iow_flags (m)); } -#ifdef _WIN32 -if (tuntap_is_wintun (m->top.c1.tuntap)) - { -if (!tuntap_ring_empty (m->top.c1.tuntap)) - { -/* there is data in wintun ring buffer, read it immediately */ - m->multi_io->esr[0 ].arg =MULTI_IO_TUN ; - m->multi_io->esr[0 ].rwflags =EVENT_READ ; - m->multi_io->n_esr =1 ; -return 1 ; - } - persistent =NULL ; - } -#endif tun_set (m->top.c1.tuntap, m->multi_io->es,EVENT_READ ,MULTI_IO_TUN , persistent);#if defined(ENABLE_DCO ) \ && (defined(TARGET_LINUX ) || defined(TARGET_FREEBSD ) || defined(TARGET_WIN32 ))
src/openvpn/options.c +4 -46
80 lines not on this page · raw message
src/openvpn/ring_buffer.h deleted +0 -125
125 lines not on this page · raw message
src/openvpn/tun.c +5 -156
221 lines not on this page · raw message
src/openvpn/tun.h +1 -149
191 lines not on this page · raw message
src/openvpnmsica/openvpnmsica.c +0 -5
@@ -320,11 +320,6 @@ L"ACTIVETAPWINDOWS6ADAPTERS");find_adapters ( hInstall, -L"Wintun" L"\0" , -L"WINTUNADAPTERS" , -L"ACTIVEWINTUNADAPTERS" ); -find_adapters ( - hInstall,L"ovpn-dco" L"\0" ,L"OVPNDCOADAPTERS" ,L"ACTIVEOVPNDCOADAPTERS" );
src/openvpnmsica/openvpnmsica.h +0 -4
@@ -88,10 +88,6 @@* ACTIVETAPWINDOWS6ADAPTERS properties with semicolon delimited list of all installed adapter * GUIDs and active adapter GUIDs respectively. * -* - Finds existing Wintun adapters and set WINTUNADAPTERS and ACTIVEWINTUNADAPTERS properties -* with semicolon delimited list of all installed adapter GUIDs and active adapter GUIDs -* respectively. -* * - Finds existing ovpn-dco adapters and set OVPNDCOADAPTERS and ACTIVEOVPNDCOADAPTERS properties * with semicolon delimited list of all installed adapter GUIDs and active adapter GUIDs * respectively.
src/openvpnserv/CMakeLists.txt +0 -1
@@ -20,7 +20,6 @@ ../tapctl/basic.h ../openvpn/wfp_block.c ../openvpn/wfp_block.h openvpnserv_resources.rc - ../openvpn/ring_buffer.h ) target_compile_options(openvpnserv PRIVATE -D_UNICODE
src/openvpnserv/Makefile.am +1 -2
@@ -36,5 +36,4 @@ service.c service.h \ validate.c validate.h \ $(top_srcdir)/src/openvpn/wfp_block.c $(top_srcdir)/src/openvpn/wfp_block.h \ - openvpnserv_resources.rc \ - $(top_srcdir)/src/openvpn/ring_buffer.h + openvpnserv_resources.rc
src/openvpnserv/interactive.c +0 -151
205 lines not on this page · raw message
src/tapctl/main.c +3 -8
@@ -75,8 +75,8 @@L" Note: This name can also be specified as OpenVPN's --dev-node \n" L" option. \n" L"--hwid <hwid> Adapter hardware ID. Default value is root\\tap0901, which \n" -L" describes tap-windows6 driver. To work with wintun or ovpn-dco \n" -L" driver, specify 'wintun' or 'ovpn-dco'. \n" +L" describes tap-windows6 driver. To work with ovpn-dco driver, \n" +L" driver, specify 'ovpn-dco'. \n" L"\n" L"Output:\n" L"\n"
@@ -94,7 +94,7 @@L"\n" L"Options:\n" L"\n" -L"--hwid <hwid> Adapter hardware ID. By default, root\\tap0901, tap0901, wintun and \n" +L"--hwid <hwid> Adapter hardware ID. By default, root\\tap0901, tap0901 and \n" L" ovpn-dco adapters are listed. Use this switch to limit the list.\n" L"\n" L"Output:\n"
@@ -167,10 +167,6 @@ { base_name =L"OpenVPN Data Channel Offload" ; } - else if (wcsicmp(hwid, L"wintun") == 0) - { - base_name =L"OpenVPN Wintun" ; - } else if (wcsicmp(hwid, L"root\\" _L(TAP_WIN_COMPONENT_ID)) == 0) { base_name =L"OpenVPN TAP-Windows6" ;
@@ -351,7 +347,6 @@WCHAR szzHwId[0x100 ] = L"root\\" _L(TAP_WIN_COMPONENT_ID) L"\0" _L(TAP_WIN_COMPONENT_ID) L"\0" -L"Wintun\0" L"ovpn-dco\0" ;/* Parse options. */
src/tapctl/tap.h +1 -1
@@ -38,7 +38,7 @@* description of the device. This pointer is optional and can be NULL. * * @param szHwId A pointer to a NULL-terminated string that supplies the hardware id -* of the device (e.g. "root\\tap0901", "Wintun"). +* of the device (e.g. "root\\tap0901"). * * @param pbRebootRequired A pointer to a BOOL flag. If the device requires a system restart, * this flag is set to TRUE. Otherwise, the flag is left unmodified. This
Attention is currently required from: flichtenheld, plaisthos, stipa.
cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email )
Change subject: win: remove Wintun support
......................................................................
Patch Set 4: Code-Review-1
(2 comments)
Patchset:
PS4:
the rebasing broke the patch, because the intermediate driver autocreation patch snuck in another WINDOWS_DRIVER_WINTUN
File src/openvpn/tun.c:
http://gerrit.openvpn.net/c/openvpn/+/1021/comment/1bb89423_93d37006 :
PS4, Line 476:
oops
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I43ec390040bffeec05270271ea7fb54fb219c536
Gerrit-Change-Number: 1021
Gerrit-PatchSet: 4
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Gerrit-Comment-Date: Tue, 13 May 2025 14:49:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: cron2, flichtenheld, plaisthos, stipa.
Hello cron2, flichtenheld, plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email
to look at the new patch set (#5).
The following approvals got outdated and were removed:
Code-Review-1 by cron2
Change subject: win: remove Wintun support
......................................................................
win: remove Wintun support
Since DCO supports modern ciphers and server mode, there is no reason to support Wintun anymore.
This also removes --windows-driver option support. The default driver is DCO, as it has been since 2.6. If for some reasons one doesn't want to use it, --disable-dco multiplatform option will switch to tap-windows6.
---
M doc/man-sections/vpn-network-options.rst
M doc/man-sections/windows-options.rst
M include/openvpn-msg.h
M src/openvpn/Makefile.am
M src/openvpn/dco.c
M src/openvpn/forward.c
M src/openvpn/forward.h
M src/openvpn/mudp.c
M src/openvpn/multi_io.c
M src/openvpn/options.c
D src/openvpn/ring_buffer.h
M src/openvpn/tun.c
M src/openvpn/tun.h
M src/openvpnmsica/openvpnmsica.c
M src/openvpnmsica/openvpnmsica.h
M src/openvpnserv/CMakeLists.txt
M src/openvpnserv/Makefile.am
M src/openvpnserv/interactive.c
M src/tapctl/main.c
M src/tapctl/tap.h
20 files changed, 27 insertions(+), 801 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/21/1021/5
doc/man-sections/vpn-network-options.rst +1 -2
@@ -137,8 +137,7 @@ Set additional network parameters on supported platforms. May be specified on the client or pushed from the server. On Windows these options are handled by the ``tap-windows6`` driver by default or directly by OpenVPN - if dhcp is disabled or the ``wintun`` driver is in use. The - ``OpenVPN for Android`` client also handles them internally. + if dhcp is disabled. The ``OpenVPN for Android`` client also handles them internally. On all other platforms these options are only saved in the client's environment under the name :code:`foreign_option_{n}` before the
doc/man-sections/windows-options.rst +0 -6
@@ -252,9 +252,3 @@ otherwise it defaulted to :code:`C:\\WINDOWS`. It is not needed to use the ``env`` keyword any more, and it will just be ignored. A warning is logged when this is found in the configuration file. - ---windows-driver drv - Specifies which tun driver to use. Values are :code:`ovpn-dco` (default), - :code:`tap-windows6` and :code:`wintun`. :code:`ovpn-dco` and :code:`wintun` - require ``--dev tun``. :code:`wintun` also requires OpenVPN process to run - elevated, or be invoked using the Interactive Service.
include/openvpn-msg.h +1 -11
@@ -44,7 +44,7 @@ msg_del_wfp_block, msg_register_dns, msg_enable_dhcp, - msg_register_ring_buffers, + deprecated_msg_register_ring_buffers, msg_set_mtu, msg_add_wins_cfg, msg_del_wins_cfg,
@@ -159,15 +159,6 @@ typedef struct { message_header_t header; -HANDLE device; -HANDLE send_ring_handle; -HANDLE receive_ring_handle; -HANDLE send_tail_moved; -HANDLE receive_tail_moved; -}register_ring_buffers_message_t ; - -typedef struct { - message_header_t header; interface_t iface; short family; int mtu;
@@ -176,7 +167,6 @@typedef enum {ADAPTER_TYPE_DCO ,ADAPTER_TYPE_TAP , -ADAPTER_TYPE_WINTUN }adapter_type_t ; typedef struct {
src/openvpn/Makefile.am +1 -1
@@ -163,6 +163,6 @@ $(OPTIONAL_DL_LIBS) \ $(OPTIONAL_INOTIFY_LIBS) if WIN32 -openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h ring_buffer.h +openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h openvpn_LDADD += -lgdi32 -lws2_32 -lwininet -lcrypt32 -liphlpapi -lwinmm -lfwpuclnt -lrpcrt4 -lncrypt -lsetupapi -lbcrypt endif
src/openvpn/dco.c +0 -8
@@ -359,14 +359,6 @@return false; } -if ((o->windows_driver ==WINDOWS_DRIVER_WINTUN ) - || (o->windows_driver ==WINDOWS_DRIVER_TAP_WINDOWS6 )) - { -msg (msglevel,"--windows-driver is set to '%s'. Disabling Data Channel Offload" , -print_tun_backend_driver (o->windows_driver)); -return false; - } -if ((o->mode ==MODE_SERVER ) && o->ce.local_list->len >1 ) {msg (msglevel,"multiple --local options defined, disabling data channel offload" );
src/openvpn/forward.c +7 -61
93 lines not on this page · raw message
src/openvpn/forward.h +2 -36
@@ -360,12 +360,6 @@ { flags |=IOW_TO_TUN ; } -#ifdef _WIN32 -if (tuntap_ring_empty (c->c1.tuntap)) - { - flags &= ~IOW_READ_TUN ; - } -#endif return flags; }
@@ -393,36 +387,8 @@ }else { -#ifdef _WIN32 -bool skip_iowait = flags &IOW_TO_TUN ; -if (flags &IOW_READ_TUN ) - { -/* -* don't read from tun if we have pending write to link, -* since every tun read overwrites to_link buffer filled -* by previous tun read -*/ - skip_iowait = !(flags &IOW_TO_LINK ); - } -if (tuntap_is_wintun (c->c1.tuntap) && skip_iowait) - { -unsigned int ret =0 ; -if (flags &IOW_TO_TUN ) - { - ret |=TUN_WRITE ; - } -if (flags &IOW_READ_TUN ) - { - ret |=TUN_READ ; - } - c->c2.event_set_status = ret; - } - else -#endif /* ifdef _WIN32 */ - { -/* slow path */ -io_wait_dowork (c, flags); - } +/* slow path */ +io_wait_dowork (c, flags); } }
src/openvpn/mudp.c +0 -6
@@ -457,11 +457,5 @@ { flags |=IOW_READ ; } -#ifdef _WIN32 -if (tuntap_ring_empty (m->top.c1.tuntap)) - { - flags &= ~IOW_READ_TUN ; - } -#endif return flags; }
src/openvpn/multi_io.c +0 -14
@@ -190,20 +190,6 @@get_io_flags_udp (&m->top, m->multi_io,p2mp_iow_flags (m)); } -#ifdef _WIN32 -if (tuntap_is_wintun (m->top.c1.tuntap)) - { -if (!tuntap_ring_empty (m->top.c1.tuntap)) - { -/* there is data in wintun ring buffer, read it immediately */ - m->multi_io->esr[0 ].arg =MULTI_IO_TUN ; - m->multi_io->esr[0 ].rwflags =EVENT_READ ; - m->multi_io->n_esr =1 ; -return 1 ; - } - persistent =NULL ; - } -#endif tun_set (m->top.c1.tuntap, m->multi_io->es,EVENT_READ ,MULTI_IO_TUN , persistent);#if defined(ENABLE_DCO ) \ && (defined(TARGET_LINUX ) || defined(TARGET_FREEBSD ) || defined(TARGET_WIN32 ))
src/openvpn/options.c +4 -46
80 lines not on this page · raw message
src/openvpn/ring_buffer.h deleted +0 -125
125 lines not on this page · raw message
src/openvpn/tun.c +5 -160
231 lines not on this page · raw message
src/openvpn/tun.h +1 -149
191 lines not on this page · raw message
src/openvpnmsica/openvpnmsica.c +0 -5
@@ -320,11 +320,6 @@ L"ACTIVETAPWINDOWS6ADAPTERS");find_adapters ( hInstall, -L"Wintun" L"\0" , -L"WINTUNADAPTERS" , -L"ACTIVEWINTUNADAPTERS" ); -find_adapters ( - hInstall,L"ovpn-dco" L"\0" ,L"OVPNDCOADAPTERS" ,L"ACTIVEOVPNDCOADAPTERS" );
src/openvpnmsica/openvpnmsica.h +0 -4
@@ -88,10 +88,6 @@* ACTIVETAPWINDOWS6ADAPTERS properties with semicolon delimited list of all installed adapter * GUIDs and active adapter GUIDs respectively. * -* - Finds existing Wintun adapters and set WINTUNADAPTERS and ACTIVEWINTUNADAPTERS properties -* with semicolon delimited list of all installed adapter GUIDs and active adapter GUIDs -* respectively. -* * - Finds existing ovpn-dco adapters and set OVPNDCOADAPTERS and ACTIVEOVPNDCOADAPTERS properties * with semicolon delimited list of all installed adapter GUIDs and active adapter GUIDs * respectively.
src/openvpnserv/CMakeLists.txt +0 -1
@@ -20,7 +20,6 @@ ../tapctl/basic.h ../openvpn/wfp_block.c ../openvpn/wfp_block.h openvpnserv_resources.rc - ../openvpn/ring_buffer.h ) target_compile_options(openvpnserv PRIVATE -D_UNICODE
src/openvpnserv/Makefile.am +1 -2
@@ -36,5 +36,4 @@ service.c service.h \ validate.c validate.h \ $(top_srcdir)/src/openvpn/wfp_block.c $(top_srcdir)/src/openvpn/wfp_block.h \ - openvpnserv_resources.rc \ - $(top_srcdir)/src/openvpn/ring_buffer.h + openvpnserv_resources.rc
src/openvpnserv/interactive.c +0 -155
215 lines not on this page · raw message
src/tapctl/main.c +3 -8
@@ -75,8 +75,8 @@L" Note: This name can also be specified as OpenVPN's --dev-node \n" L" option. \n" L"--hwid <hwid> Adapter hardware ID. Default value is root\\tap0901, which \n" -L" describes tap-windows6 driver. To work with wintun or ovpn-dco \n" -L" driver, specify 'wintun' or 'ovpn-dco'. \n" +L" describes tap-windows6 driver. To work with ovpn-dco driver, \n" +L" driver, specify 'ovpn-dco'. \n" L"\n" L"Output:\n" L"\n"
@@ -94,7 +94,7 @@L"\n" L"Options:\n" L"\n" -L"--hwid <hwid> Adapter hardware ID. By default, root\\tap0901, tap0901, wintun and \n" +L"--hwid <hwid> Adapter hardware ID. By default, root\\tap0901, tap0901 and \n" L" ovpn-dco adapters are listed. Use this switch to limit the list.\n" L"\n" L"Output:\n"
@@ -167,10 +167,6 @@ { base_name =L"OpenVPN Data Channel Offload" ; } - else if (wcsicmp(hwid, L"wintun") == 0) - { - base_name =L"OpenVPN Wintun" ; - } else if (wcsicmp(hwid, L"root\\" _L(TAP_WIN_COMPONENT_ID)) == 0) { base_name =L"OpenVPN TAP-Windows6" ;
@@ -351,7 +347,6 @@WCHAR szzHwId[0x100 ] = L"root\\" _L(TAP_WIN_COMPONENT_ID) L"\0" _L(TAP_WIN_COMPONENT_ID) L"\0" -L"Wintun\0" L"ovpn-dco\0" ;/* Parse options. */
src/tapctl/tap.h +1 -1
@@ -38,7 +38,7 @@* description of the device. This pointer is optional and can be NULL. * * @param szHwId A pointer to a NULL-terminated string that supplies the hardware id -* of the device (e.g. "root\\tap0901", "Wintun"). +* of the device (e.g. "root\\tap0901"). * * @param pbRebootRequired A pointer to a BOOL flag. If the device requires a system restart, * this flag is set to TRUE. Otherwise, the flag is left unmodified. This
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I43ec390040bffeec05270271ea7fb54fb219c536
Gerrit-Change-Number: 1021
Gerrit-PatchSet: 5
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Gerrit-MessageType: newpatchset
Attention is currently required from: flichtenheld, plaisthos, stipa.
cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email )
Change subject: win: remove Wintun support
......................................................................
Patch Set 5: Code-Review+2
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I43ec390040bffeec05270271ea7fb54fb219c536
Gerrit-Change-Number: 1021
Gerrit-PatchSet: 5
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Gerrit-Comment-Date: Tue, 13 May 2025 15:09:00 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
PATCH v5 1/1 win: remove Wintun support
In reply to a message not in the archiveFrom: Lev Stipakov <[email protected]...>
Since DCO supports modern ciphers and server mode, there is no reason to support Wintun anymore.
This also removes --windows-driver option support. The default driver is DCO, as it has been since 2.6. If for some reasons one doesn't want to use it, --disable-dco multiplatform option will switch to tap-windows6.
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1021
This mail reflects revision 5 of this Change.
Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>
doc/man-sections/vpn-network-options.rst +1 -2
@@ -137,8 +137,7 @@ Set additional network parameters on supported platforms. May be specified on the client or pushed from the server. On Windows these options are handled by the ``tap-windows6`` driver by default or directly by OpenVPN - if dhcp is disabled or the ``wintun`` driver is in use. The - ``OpenVPN for Android`` client also handles them internally. + if dhcp is disabled. The ``OpenVPN for Android`` client also handles them internally. On all other platforms these options are only saved in the client's environment under the name :code:`foreign_option_{n}` before the
doc/man-sections/windows-options.rst +0 -6
@@ -252,9 +252,3 @@ otherwise it defaulted to :code:`C:\\WINDOWS`. It is not needed to use the ``env`` keyword any more, and it will just be ignored. A warning is logged when this is found in the configuration file. - ---windows-driver drv - Specifies which tun driver to use. Values are :code:`ovpn-dco` (default), - :code:`tap-windows6` and :code:`wintun`. :code:`ovpn-dco` and :code:`wintun` - require ``--dev tun``. :code:`wintun` also requires OpenVPN process to run - elevated, or be invoked using the Interactive Service.
include/openvpn-msg.h +1 -11
@@ -44,7 +44,7 @@ msg_del_wfp_block, msg_register_dns, msg_enable_dhcp, - msg_register_ring_buffers, + deprecated_msg_register_ring_buffers, msg_set_mtu, msg_add_wins_cfg, msg_del_wins_cfg,
@@ -159,15 +159,6 @@ typedef struct { message_header_t header; -HANDLE device; -HANDLE send_ring_handle; -HANDLE receive_ring_handle; -HANDLE send_tail_moved; -HANDLE receive_tail_moved; -}register_ring_buffers_message_t ; - -typedef struct { - message_header_t header; interface_t iface; short family; int mtu;
@@ -176,7 +167,6 @@typedef enum {ADAPTER_TYPE_DCO ,ADAPTER_TYPE_TAP , -ADAPTER_TYPE_WINTUN }adapter_type_t ; typedef struct {
src/openvpn/Makefile.am +1 -1
@@ -163,6 +163,6 @@ $(OPTIONAL_DL_LIBS) \ $(OPTIONAL_INOTIFY_LIBS) if WIN32 -openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h ring_buffer.h +openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h openvpn_LDADD += -lgdi32 -lws2_32 -lwininet -lcrypt32 -liphlpapi -lwinmm -lfwpuclnt -lrpcrt4 -lncrypt -lsetupapi -lbcrypt endif
src/openvpn/dco.c +0 -8
@@ -359,14 +359,6 @@return false; } -if ((o->windows_driver ==WINDOWS_DRIVER_WINTUN ) - || (o->windows_driver ==WINDOWS_DRIVER_TAP_WINDOWS6 )) - { -msg (msglevel,"--windows-driver is set to '%s'. Disabling Data Channel Offload" , -print_tun_backend_driver (o->windows_driver)); -return false; - } -if ((o->mode ==MODE_SERVER ) && o->ce.local_list->len >1 ) {msg (msglevel,"multiple --local options defined, disabling data channel offload" );
src/openvpn/forward.c +7 -61
93 lines not on this page · raw message
src/openvpn/forward.h +2 -36
@@ -360,12 +360,6 @@ { flags |=IOW_TO_TUN ; } -#ifdef _WIN32 -if (tuntap_ring_empty (c->c1.tuntap)) - { - flags &= ~IOW_READ_TUN ; - } -#endif return flags; }
@@ -393,36 +387,8 @@ }else { -#ifdef _WIN32 -bool skip_iowait = flags &IOW_TO_TUN ; -if (flags &IOW_READ_TUN ) - { -/* -* don't read from tun if we have pending write to link, -* since every tun read overwrites to_link buffer filled -* by previous tun read -*/ - skip_iowait = !(flags &IOW_TO_LINK ); - } -if (tuntap_is_wintun (c->c1.tuntap) && skip_iowait) - { -unsigned int ret =0 ; -if (flags &IOW_TO_TUN ) - { - ret |=TUN_WRITE ; - } -if (flags &IOW_READ_TUN ) - { - ret |=TUN_READ ; - } - c->c2.event_set_status = ret; - } - else -#endif /* ifdef _WIN32 */ - { -/* slow path */ -io_wait_dowork (c, flags); - } +/* slow path */ +io_wait_dowork (c, flags); } }
src/openvpn/mudp.c +0 -6
@@ -457,11 +457,5 @@ { flags |=IOW_READ ; } -#ifdef _WIN32 -if (tuntap_ring_empty (m->top.c1.tuntap)) - { - flags &= ~IOW_READ_TUN ; - } -#endif return flags; }
src/openvpn/multi_io.c +0 -14
@@ -190,20 +190,6 @@get_io_flags_udp (&m->top, m->multi_io,p2mp_iow_flags (m)); } -#ifdef _WIN32 -if (tuntap_is_wintun (m->top.c1.tuntap)) - { -if (!tuntap_ring_empty (m->top.c1.tuntap)) - { -/* there is data in wintun ring buffer, read it immediately */ - m->multi_io->esr[0 ].arg =MULTI_IO_TUN ; - m->multi_io->esr[0 ].rwflags =EVENT_READ ; - m->multi_io->n_esr =1 ; -return 1 ; - } - persistent =NULL ; - } -#endif tun_set (m->top.c1.tuntap, m->multi_io->es,EVENT_READ ,MULTI_IO_TUN , persistent);#if defined(ENABLE_DCO ) \ && (defined(TARGET_LINUX ) || defined(TARGET_FREEBSD ) || defined(TARGET_WIN32 ))
src/openvpn/options.c +4 -46
80 lines not on this page · raw message
src/openvpn/ring_buffer.h deleted +0 -125
125 lines not on this page · raw message
src/openvpn/tun.c +5 -160
231 lines not on this page · raw message
src/openvpn/tun.h +1 -149
191 lines not on this page · raw message
src/openvpnmsica/openvpnmsica.c +0 -5
@@ -320,11 +320,6 @@ L"ACTIVETAPWINDOWS6ADAPTERS");find_adapters ( hInstall, -L"Wintun" L"\0" , -L"WINTUNADAPTERS" , -L"ACTIVEWINTUNADAPTERS" ); -find_adapters ( - hInstall,L"ovpn-dco" L"\0" ,L"OVPNDCOADAPTERS" ,L"ACTIVEOVPNDCOADAPTERS" );
src/openvpnmsica/openvpnmsica.h +0 -4
@@ -88,10 +88,6 @@* ACTIVETAPWINDOWS6ADAPTERS properties with semicolon delimited list of all installed adapter * GUIDs and active adapter GUIDs respectively. * -* - Finds existing Wintun adapters and set WINTUNADAPTERS and ACTIVEWINTUNADAPTERS properties -* with semicolon delimited list of all installed adapter GUIDs and active adapter GUIDs -* respectively. -* * - Finds existing ovpn-dco adapters and set OVPNDCOADAPTERS and ACTIVEOVPNDCOADAPTERS properties * with semicolon delimited list of all installed adapter GUIDs and active adapter GUIDs * respectively.
src/openvpnserv/CMakeLists.txt +0 -1
@@ -20,7 +20,6 @@ ../tapctl/basic.h ../openvpn/wfp_block.c ../openvpn/wfp_block.h openvpnserv_resources.rc - ../openvpn/ring_buffer.h ) target_compile_options(openvpnserv PRIVATE -D_UNICODE
src/openvpnserv/Makefile.am +1 -2
@@ -36,5 +36,4 @@ service.c service.h \ validate.c validate.h \ $(top_srcdir)/src/openvpn/wfp_block.c $(top_srcdir)/src/openvpn/wfp_block.h \ - openvpnserv_resources.rc \ - $(top_srcdir)/src/openvpn/ring_buffer.h + openvpnserv_resources.rc
src/openvpnserv/interactive.c +0 -155
215 lines not on this page · raw message
src/tapctl/main.c +3 -8
@@ -75,8 +75,8 @@L" Note: This name can also be specified as OpenVPN's --dev-node \n" L" option. \n" L"--hwid <hwid> Adapter hardware ID. Default value is root\\tap0901, which \n" -L" describes tap-windows6 driver. To work with wintun or ovpn-dco \n" -L" driver, specify 'wintun' or 'ovpn-dco'. \n" +L" describes tap-windows6 driver. To work with ovpn-dco driver, \n" +L" driver, specify 'ovpn-dco'. \n" L"\n" L"Output:\n" L"\n"
@@ -94,7 +94,7 @@L"\n" L"Options:\n" L"\n" -L"--hwid <hwid> Adapter hardware ID. By default, root\\tap0901, tap0901, wintun and \n" +L"--hwid <hwid> Adapter hardware ID. By default, root\\tap0901, tap0901 and \n" L" ovpn-dco adapters are listed. Use this switch to limit the list.\n" L"\n" L"Output:\n"
@@ -167,10 +167,6 @@ { base_name =L"OpenVPN Data Channel Offload" ; } - else if (wcsicmp(hwid, L"wintun") == 0) - { - base_name =L"OpenVPN Wintun" ; - } else if (wcsicmp(hwid, L"root\\" _L(TAP_WIN_COMPONENT_ID)) == 0) { base_name =L"OpenVPN TAP-Windows6" ;
@@ -351,7 +347,6 @@WCHAR szzHwId[0x100 ] = L"root\\" _L(TAP_WIN_COMPONENT_ID) L"\0" _L(TAP_WIN_COMPONENT_ID) L"\0" -L"Wintun\0" L"ovpn-dco\0" ;/* Parse options. */
src/tapctl/tap.h +1 -1
@@ -38,7 +38,7 @@* description of the device. This pointer is optional and can be NULL. * * @param szHwId A pointer to a NULL-terminated string that supplies the hardware id -* of the device (e.g. "root\\tap0901", "Wintun"). +* of the device (e.g. "root\\tap0901"). * * @param pbRebootRequired A pointer to a BOOL flag. If the device requires a system restart, * this flag is set to TRUE. Otherwise, the flag is left unmodified. This
[Openvpn-devel] [PATCH applied] Re: win: remove Wintun support
The patch looks big, and we needed a few tries due to conflicts with the commit before that also changed message types *and* introduced a WINTUN references... sorry for the noise.
Under the hood, the patch is quit simple, just taking away special case branches and code, and I like that a lot :-)
Tested building via GHA, the new windows based buildbot and a local MinGW build. Stared a lot at the code and asked questions...
Your patch has been applied to the master branch.
commit ad7a6945144bc6d8e3347b8008e5a31d91f23cd4
Author: Lev Stipakov Date: Tue May 13 17:09:59 2025 +0200
win: remove Wintun support
Signed-off-by: Lev Stipakov <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg31631.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
cron2 has uploaded a new patch set (#6) to the change originally created by stipa. ( http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email )
The following approvals got outdated and were removed:
Code-Review+2 by cron2
Change subject: win: remove Wintun support
......................................................................
win: remove Wintun support
Since DCO supports modern ciphers and server mode, there is no reason to support Wintun anymore.
This also removes --windows-driver option support. The default driver is DCO, as it has been since 2.6. If for some reasons one doesn't want to use it, --disable-dco multiplatform option will switch to tap-windows6.
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg31631.html
---
M doc/man-sections/vpn-network-options.rst
M doc/man-sections/windows-options.rst
M include/openvpn-msg.h
M src/openvpn/Makefile.am
M src/openvpn/dco.c
M src/openvpn/forward.c
M src/openvpn/forward.h
M src/openvpn/mudp.c
M src/openvpn/multi_io.c
M src/openvpn/options.c
D src/openvpn/ring_buffer.h
M src/openvpn/tun.c
M src/openvpn/tun.h
M src/openvpnmsica/openvpnmsica.c
M src/openvpnmsica/openvpnmsica.h
M src/openvpnserv/CMakeLists.txt
M src/openvpnserv/Makefile.am
M src/openvpnserv/interactive.c
M src/tapctl/main.c
M src/tapctl/tap.h
20 files changed, 27 insertions(+), 801 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/21/1021/6
doc/man-sections/vpn-network-options.rst +1 -2
@@ -137,8 +137,7 @@ Set additional network parameters on supported platforms. May be specified on the client or pushed from the server. On Windows these options are handled by the ``tap-windows6`` driver by default or directly by OpenVPN - if dhcp is disabled or the ``wintun`` driver is in use. The - ``OpenVPN for Android`` client also handles them internally. + if dhcp is disabled. The ``OpenVPN for Android`` client also handles them internally. On all other platforms these options are only saved in the client's environment under the name :code:`foreign_option_{n}` before the
doc/man-sections/windows-options.rst +0 -6
@@ -252,9 +252,3 @@ otherwise it defaulted to :code:`C:\\WINDOWS`. It is not needed to use the ``env`` keyword any more, and it will just be ignored. A warning is logged when this is found in the configuration file. - ---windows-driver drv - Specifies which tun driver to use. Values are :code:`ovpn-dco` (default), - :code:`tap-windows6` and :code:`wintun`. :code:`ovpn-dco` and :code:`wintun` - require ``--dev tun``. :code:`wintun` also requires OpenVPN process to run - elevated, or be invoked using the Interactive Service.
include/openvpn-msg.h +1 -11
@@ -44,7 +44,7 @@ msg_del_wfp_block, msg_register_dns, msg_enable_dhcp, - msg_register_ring_buffers, + deprecated_msg_register_ring_buffers, msg_set_mtu, msg_add_wins_cfg, msg_del_wins_cfg,
@@ -159,15 +159,6 @@ typedef struct { message_header_t header; -HANDLE device; -HANDLE send_ring_handle; -HANDLE receive_ring_handle; -HANDLE send_tail_moved; -HANDLE receive_tail_moved; -}register_ring_buffers_message_t ; - -typedef struct { - message_header_t header; interface_t iface; short family; int mtu;
@@ -176,7 +167,6 @@typedef enum {ADAPTER_TYPE_DCO ,ADAPTER_TYPE_TAP , -ADAPTER_TYPE_WINTUN }adapter_type_t ; typedef struct {
src/openvpn/Makefile.am +1 -1
@@ -163,6 +163,6 @@ $(OPTIONAL_DL_LIBS) \ $(OPTIONAL_INOTIFY_LIBS) if WIN32 -openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h ring_buffer.h +openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h openvpn_LDADD += -lgdi32 -lws2_32 -lwininet -lcrypt32 -liphlpapi -lwinmm -lfwpuclnt -lrpcrt4 -lncrypt -lsetupapi -lbcrypt endif
src/openvpn/dco.c +0 -8
@@ -359,14 +359,6 @@return false; } -if ((o->windows_driver ==WINDOWS_DRIVER_WINTUN ) - || (o->windows_driver ==WINDOWS_DRIVER_TAP_WINDOWS6 )) - { -msg (msglevel,"--windows-driver is set to '%s'. Disabling Data Channel Offload" , -print_tun_backend_driver (o->windows_driver)); -return false; - } -if ((o->mode ==MODE_SERVER ) && o->ce.local_list->len >1 ) {msg (msglevel,"multiple --local options defined, disabling data channel offload" );
src/openvpn/forward.c +7 -61
93 lines not on this page · raw message
src/openvpn/forward.h +2 -36
@@ -360,12 +360,6 @@ { flags |=IOW_TO_TUN ; } -#ifdef _WIN32 -if (tuntap_ring_empty (c->c1.tuntap)) - { - flags &= ~IOW_READ_TUN ; - } -#endif return flags; }
@@ -393,36 +387,8 @@ }else { -#ifdef _WIN32 -bool skip_iowait = flags &IOW_TO_TUN ; -if (flags &IOW_READ_TUN ) - { -/* -* don't read from tun if we have pending write to link, -* since every tun read overwrites to_link buffer filled -* by previous tun read -*/ - skip_iowait = !(flags &IOW_TO_LINK ); - } -if (tuntap_is_wintun (c->c1.tuntap) && skip_iowait) - { -unsigned int ret =0 ; -if (flags &IOW_TO_TUN ) - { - ret |=TUN_WRITE ; - } -if (flags &IOW_READ_TUN ) - { - ret |=TUN_READ ; - } - c->c2.event_set_status = ret; - } - else -#endif /* ifdef _WIN32 */ - { -/* slow path */ -io_wait_dowork (c, flags); - } +/* slow path */ +io_wait_dowork (c, flags); } }
src/openvpn/mudp.c +0 -6
@@ -457,11 +457,5 @@ { flags |=IOW_READ ; } -#ifdef _WIN32 -if (tuntap_ring_empty (m->top.c1.tuntap)) - { - flags &= ~IOW_READ_TUN ; - } -#endif return flags; }
src/openvpn/multi_io.c +0 -14
@@ -190,20 +190,6 @@get_io_flags_udp (&m->top, m->multi_io,p2mp_iow_flags (m)); } -#ifdef _WIN32 -if (tuntap_is_wintun (m->top.c1.tuntap)) - { -if (!tuntap_ring_empty (m->top.c1.tuntap)) - { -/* there is data in wintun ring buffer, read it immediately */ - m->multi_io->esr[0 ].arg =MULTI_IO_TUN ; - m->multi_io->esr[0 ].rwflags =EVENT_READ ; - m->multi_io->n_esr =1 ; -return 1 ; - } - persistent =NULL ; - } -#endif tun_set (m->top.c1.tuntap, m->multi_io->es,EVENT_READ ,MULTI_IO_TUN , persistent);#if defined(ENABLE_DCO ) \ && (defined(TARGET_LINUX ) || defined(TARGET_FREEBSD ) || defined(TARGET_WIN32 ))
src/openvpn/options.c +4 -46
80 lines not on this page · raw message
src/openvpn/ring_buffer.h deleted +0 -125
125 lines not on this page · raw message
src/openvpn/tun.c +5 -160
231 lines not on this page · raw message
src/openvpn/tun.h +1 -149
191 lines not on this page · raw message
src/openvpnmsica/openvpnmsica.c +0 -5
@@ -320,11 +320,6 @@ L"ACTIVETAPWINDOWS6ADAPTERS");find_adapters ( hInstall, -L"Wintun" L"\0" , -L"WINTUNADAPTERS" , -L"ACTIVEWINTUNADAPTERS" ); -find_adapters ( - hInstall,L"ovpn-dco" L"\0" ,L"OVPNDCOADAPTERS" ,L"ACTIVEOVPNDCOADAPTERS" );
src/openvpnmsica/openvpnmsica.h +0 -4
@@ -88,10 +88,6 @@* ACTIVETAPWINDOWS6ADAPTERS properties with semicolon delimited list of all installed adapter * GUIDs and active adapter GUIDs respectively. * -* - Finds existing Wintun adapters and set WINTUNADAPTERS and ACTIVEWINTUNADAPTERS properties -* with semicolon delimited list of all installed adapter GUIDs and active adapter GUIDs -* respectively. -* * - Finds existing ovpn-dco adapters and set OVPNDCOADAPTERS and ACTIVEOVPNDCOADAPTERS properties * with semicolon delimited list of all installed adapter GUIDs and active adapter GUIDs * respectively.
src/openvpnserv/CMakeLists.txt +0 -1
@@ -20,7 +20,6 @@ ../tapctl/basic.h ../openvpn/wfp_block.c ../openvpn/wfp_block.h openvpnserv_resources.rc - ../openvpn/ring_buffer.h ) target_compile_options(openvpnserv PRIVATE -D_UNICODE
src/openvpnserv/Makefile.am +1 -2
@@ -36,5 +36,4 @@ service.c service.h \ validate.c validate.h \ $(top_srcdir)/src/openvpn/wfp_block.c $(top_srcdir)/src/openvpn/wfp_block.h \ - openvpnserv_resources.rc \ - $(top_srcdir)/src/openvpn/ring_buffer.h + openvpnserv_resources.rc
src/openvpnserv/interactive.c +0 -155
215 lines not on this page · raw message
src/tapctl/main.c +3 -8
@@ -75,8 +75,8 @@L" Note: This name can also be specified as OpenVPN's --dev-node \n" L" option. \n" L"--hwid <hwid> Adapter hardware ID. Default value is root\\tap0901, which \n" -L" describes tap-windows6 driver. To work with wintun or ovpn-dco \n" -L" driver, specify 'wintun' or 'ovpn-dco'. \n" +L" describes tap-windows6 driver. To work with ovpn-dco driver, \n" +L" driver, specify 'ovpn-dco'. \n" L"\n" L"Output:\n" L"\n"
@@ -94,7 +94,7 @@L"\n" L"Options:\n" L"\n" -L"--hwid <hwid> Adapter hardware ID. By default, root\\tap0901, tap0901, wintun and \n" +L"--hwid <hwid> Adapter hardware ID. By default, root\\tap0901, tap0901 and \n" L" ovpn-dco adapters are listed. Use this switch to limit the list.\n" L"\n" L"Output:\n"
@@ -167,10 +167,6 @@ { base_name =L"OpenVPN Data Channel Offload" ; } - else if (wcsicmp(hwid, L"wintun") == 0) - { - base_name =L"OpenVPN Wintun" ; - } else if (wcsicmp(hwid, L"root\\" _L(TAP_WIN_COMPONENT_ID)) == 0) { base_name =L"OpenVPN TAP-Windows6" ;
@@ -351,7 +347,6 @@WCHAR szzHwId[0x100 ] = L"root\\" _L(TAP_WIN_COMPONENT_ID) L"\0" _L(TAP_WIN_COMPONENT_ID) L"\0" -L"Wintun\0" L"ovpn-dco\0" ;/* Parse options. */
src/tapctl/tap.h +1 -1
@@ -38,7 +38,7 @@* description of the device. This pointer is optional and can be NULL. * * @param szHwId A pointer to a NULL-terminated string that supplies the hardware id -* of the device (e.g. "root\\tap0901", "Wintun"). +* of the device (e.g. "root\\tap0901"). * * @param pbRebootRequired A pointer to a BOOL flag. If the device requires a system restart, * this flag is set to TRUE. Otherwise, the flag is left unmodified. This
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I43ec390040bffeec05270271ea7fb54fb219c536
Gerrit-Change-Number: 1021
Gerrit-PatchSet: 6
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset
cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email )
Change subject: win: remove Wintun support
......................................................................
win: remove Wintun support
Since DCO supports modern ciphers and server mode, there is no reason to support Wintun anymore.
This also removes --windows-driver option support. The default driver is DCO, as it has been since 2.6. If for some reasons one doesn't want to use it, --disable-dco multiplatform option will switch to tap-windows6.
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg31631.html
---
M doc/man-sections/vpn-network-options.rst
M doc/man-sections/windows-options.rst
M include/openvpn-msg.h
M src/openvpn/Makefile.am
M src/openvpn/dco.c
M src/openvpn/forward.c
M src/openvpn/forward.h
M src/openvpn/mudp.c
M src/openvpn/multi_io.c
M src/openvpn/options.c
D src/openvpn/ring_buffer.h
M src/openvpn/tun.c
M src/openvpn/tun.h
M src/openvpnmsica/openvpnmsica.c
M src/openvpnmsica/openvpnmsica.h
M src/openvpnserv/CMakeLists.txt
M src/openvpnserv/Makefile.am
M src/openvpnserv/interactive.c
M src/tapctl/main.c
M src/tapctl/tap.h
20 files changed, 27 insertions(+), 801 deletions(-)
doc/man-sections/vpn-network-options.rst +1 -2
@@ -137,8 +137,7 @@ Set additional network parameters on supported platforms. May be specified on the client or pushed from the server. On Windows these options are handled by the ``tap-windows6`` driver by default or directly by OpenVPN - if dhcp is disabled or the ``wintun`` driver is in use. The - ``OpenVPN for Android`` client also handles them internally. + if dhcp is disabled. The ``OpenVPN for Android`` client also handles them internally. On all other platforms these options are only saved in the client's environment under the name :code:`foreign_option_{n}` before the
doc/man-sections/windows-options.rst +0 -6
@@ -252,9 +252,3 @@ otherwise it defaulted to :code:`C:\\WINDOWS`. It is not needed to use the ``env`` keyword any more, and it will just be ignored. A warning is logged when this is found in the configuration file. - ---windows-driver drv - Specifies which tun driver to use. Values are :code:`ovpn-dco` (default), - :code:`tap-windows6` and :code:`wintun`. :code:`ovpn-dco` and :code:`wintun` - require ``--dev tun``. :code:`wintun` also requires OpenVPN process to run - elevated, or be invoked using the Interactive Service.
include/openvpn-msg.h +1 -11
@@ -44,7 +44,7 @@ msg_del_wfp_block, msg_register_dns, msg_enable_dhcp, - msg_register_ring_buffers, + deprecated_msg_register_ring_buffers, msg_set_mtu, msg_add_wins_cfg, msg_del_wins_cfg,
@@ -159,15 +159,6 @@ typedef struct { message_header_t header; -HANDLE device; -HANDLE send_ring_handle; -HANDLE receive_ring_handle; -HANDLE send_tail_moved; -HANDLE receive_tail_moved; -}register_ring_buffers_message_t ; - -typedef struct { - message_header_t header; interface_t iface; short family; int mtu;
@@ -176,7 +167,6 @@typedef enum {ADAPTER_TYPE_DCO ,ADAPTER_TYPE_TAP , -ADAPTER_TYPE_WINTUN }adapter_type_t ; typedef struct {
src/openvpn/Makefile.am +1 -1
@@ -163,6 +163,6 @@ $(OPTIONAL_DL_LIBS) \ $(OPTIONAL_INOTIFY_LIBS) if WIN32 -openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h ring_buffer.h +openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h openvpn_LDADD += -lgdi32 -lws2_32 -lwininet -lcrypt32 -liphlpapi -lwinmm -lfwpuclnt -lrpcrt4 -lncrypt -lsetupapi -lbcrypt endif
src/openvpn/dco.c +0 -8
@@ -359,14 +359,6 @@return false; } -if ((o->windows_driver ==WINDOWS_DRIVER_WINTUN ) - || (o->windows_driver ==WINDOWS_DRIVER_TAP_WINDOWS6 )) - { -msg (msglevel,"--windows-driver is set to '%s'. Disabling Data Channel Offload" , -print_tun_backend_driver (o->windows_driver)); -return false; - } -if ((o->mode ==MODE_SERVER ) && o->ce.local_list->len >1 ) {msg (msglevel,"multiple --local options defined, disabling data channel offload" );
src/openvpn/forward.c +7 -61
93 lines not on this page · raw message
src/openvpn/forward.h +2 -36
@@ -360,12 +360,6 @@ { flags |=IOW_TO_TUN ; } -#ifdef _WIN32 -if (tuntap_ring_empty (c->c1.tuntap)) - { - flags &= ~IOW_READ_TUN ; - } -#endif return flags; }
@@ -393,36 +387,8 @@ }else { -#ifdef _WIN32 -bool skip_iowait = flags &IOW_TO_TUN ; -if (flags &IOW_READ_TUN ) - { -/* -* don't read from tun if we have pending write to link, -* since every tun read overwrites to_link buffer filled -* by previous tun read -*/ - skip_iowait = !(flags &IOW_TO_LINK ); - } -if (tuntap_is_wintun (c->c1.tuntap) && skip_iowait) - { -unsigned int ret =0 ; -if (flags &IOW_TO_TUN ) - { - ret |=TUN_WRITE ; - } -if (flags &IOW_READ_TUN ) - { - ret |=TUN_READ ; - } - c->c2.event_set_status = ret; - } - else -#endif /* ifdef _WIN32 */ - { -/* slow path */ -io_wait_dowork (c, flags); - } +/* slow path */ +io_wait_dowork (c, flags); } }
src/openvpn/mudp.c +0 -6
@@ -457,11 +457,5 @@ { flags |=IOW_READ ; } -#ifdef _WIN32 -if (tuntap_ring_empty (m->top.c1.tuntap)) - { - flags &= ~IOW_READ_TUN ; - } -#endif return flags; }
src/openvpn/multi_io.c +0 -14
@@ -190,20 +190,6 @@get_io_flags_udp (&m->top, m->multi_io,p2mp_iow_flags (m)); } -#ifdef _WIN32 -if (tuntap_is_wintun (m->top.c1.tuntap)) - { -if (!tuntap_ring_empty (m->top.c1.tuntap)) - { -/* there is data in wintun ring buffer, read it immediately */ - m->multi_io->esr[0 ].arg =MULTI_IO_TUN ; - m->multi_io->esr[0 ].rwflags =EVENT_READ ; - m->multi_io->n_esr =1 ; -return 1 ; - } - persistent =NULL ; - } -#endif tun_set (m->top.c1.tuntap, m->multi_io->es,EVENT_READ ,MULTI_IO_TUN , persistent);#if defined(ENABLE_DCO ) \ && (defined(TARGET_LINUX ) || defined(TARGET_FREEBSD ) || defined(TARGET_WIN32 ))
src/openvpn/options.c +4 -46
80 lines not on this page · raw message
src/openvpn/ring_buffer.h deleted +0 -125
125 lines not on this page · raw message
src/openvpn/tun.c +5 -160
231 lines not on this page · raw message
src/openvpn/tun.h +1 -149
191 lines not on this page · raw message
src/openvpnmsica/openvpnmsica.c +0 -5
@@ -320,11 +320,6 @@ L"ACTIVETAPWINDOWS6ADAPTERS");find_adapters ( hInstall, -L"Wintun" L"\0" , -L"WINTUNADAPTERS" , -L"ACTIVEWINTUNADAPTERS" ); -find_adapters ( - hInstall,L"ovpn-dco" L"\0" ,L"OVPNDCOADAPTERS" ,L"ACTIVEOVPNDCOADAPTERS" );
src/openvpnmsica/openvpnmsica.h +0 -4
@@ -88,10 +88,6 @@* ACTIVETAPWINDOWS6ADAPTERS properties with semicolon delimited list of all installed adapter * GUIDs and active adapter GUIDs respectively. * -* - Finds existing Wintun adapters and set WINTUNADAPTERS and ACTIVEWINTUNADAPTERS properties -* with semicolon delimited list of all installed adapter GUIDs and active adapter GUIDs -* respectively. -* * - Finds existing ovpn-dco adapters and set OVPNDCOADAPTERS and ACTIVEOVPNDCOADAPTERS properties * with semicolon delimited list of all installed adapter GUIDs and active adapter GUIDs * respectively.
src/openvpnserv/CMakeLists.txt +0 -1
@@ -20,7 +20,6 @@ ../tapctl/basic.h ../openvpn/wfp_block.c ../openvpn/wfp_block.h openvpnserv_resources.rc - ../openvpn/ring_buffer.h ) target_compile_options(openvpnserv PRIVATE -D_UNICODE
src/openvpnserv/Makefile.am +1 -2
@@ -36,5 +36,4 @@ service.c service.h \ validate.c validate.h \ $(top_srcdir)/src/openvpn/wfp_block.c $(top_srcdir)/src/openvpn/wfp_block.h \ - openvpnserv_resources.rc \ - $(top_srcdir)/src/openvpn/ring_buffer.h + openvpnserv_resources.rc
src/openvpnserv/interactive.c +0 -155
215 lines not on this page · raw message
src/tapctl/main.c +3 -8
@@ -75,8 +75,8 @@L" Note: This name can also be specified as OpenVPN's --dev-node \n" L" option. \n" L"--hwid <hwid> Adapter hardware ID. Default value is root\\tap0901, which \n" -L" describes tap-windows6 driver. To work with wintun or ovpn-dco \n" -L" driver, specify 'wintun' or 'ovpn-dco'. \n" +L" describes tap-windows6 driver. To work with ovpn-dco driver, \n" +L" driver, specify 'ovpn-dco'. \n" L"\n" L"Output:\n" L"\n"
@@ -94,7 +94,7 @@L"\n" L"Options:\n" L"\n" -L"--hwid <hwid> Adapter hardware ID. By default, root\\tap0901, tap0901, wintun and \n" +L"--hwid <hwid> Adapter hardware ID. By default, root\\tap0901, tap0901 and \n" L" ovpn-dco adapters are listed. Use this switch to limit the list.\n" L"\n" L"Output:\n"
@@ -167,10 +167,6 @@ { base_name =L"OpenVPN Data Channel Offload" ; } - else if (wcsicmp(hwid, L"wintun") == 0) - { - base_name =L"OpenVPN Wintun" ; - } else if (wcsicmp(hwid, L"root\\" _L(TAP_WIN_COMPONENT_ID)) == 0) { base_name =L"OpenVPN TAP-Windows6" ;
@@ -351,7 +347,6 @@WCHAR szzHwId[0x100 ] = L"root\\" _L(TAP_WIN_COMPONENT_ID) L"\0" _L(TAP_WIN_COMPONENT_ID) L"\0" -L"Wintun\0" L"ovpn-dco\0" ;/* Parse options. */
src/tapctl/tap.h +1 -1
@@ -38,7 +38,7 @@* description of the device. This pointer is optional and can be NULL. * * @param szHwId A pointer to a NULL-terminated string that supplies the hardware id -* of the device (e.g. "root\\tap0901", "Wintun"). +* of the device (e.g. "root\\tap0901"). * * @param pbRebootRequired A pointer to a BOOL flag. If the device requires a system restart, * this flag is set to TRUE. Otherwise, the flag is left unmodified. This
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1021?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I43ec390040bffeec05270271ea7fb54fb219c536
Gerrit-Change-Number: 1021
Gerrit-PatchSet: 6
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged